<template>
	<view class="container">
		<view class="index_dialog" v-if="isShowDialog">
			<image class="dialog_banner" src="@/static/images/dialogone.png" mode=""></image>
			<image @click="isShowDialog=false" class="dialog_clone" src="@/static/images/close_icon.png" mode="">
			</image>
		</view>
		<view class="right-bottom">
			<view v-if="isShowClick" class="connection">
				<view class="header">
					<view class="header_content">
						<view class="line-list"></view>
						<view class="header-title">联系方式</view>
					</view>
					<image @click="isShowClick = false" class="close-icon" src="../../static/images/close_icon1.png"
						mode="widthFix"></image>
				</view>
				<view class="xian"></view>
				<view class="connection-list">
					<view class="connection-item">
						<view class="connection-item-image">
							<image src="../../static/images/wechat.png" mode="widthFix"></image>
						</view>
						<view class="connection-item-title">{{data.systemInfo.wechat}}</view>
					</view>
					<view class="connection-item">
						<view class="connection-item-image">
							<image src="../../static/images/phone.png" mode="widthFix"></image>
						</view>
						<view class="connection-item-title">{{data.systemInfo.phone}}</view>
					</view>
					<view class="connection-item">
						<view class="connection-item-image">
							<image src="../../static/images/phone1.png" mode="widthFix"></image>
						</view>
						<view class="connection-item-title">{{data.systemInfo.telephone}}</view>
					</view>
				</view>
			</view>
			<view class="float-image" v-else>
				<image src="../../static/images/Group10.png" @click="isShowClick = true" class="float-image-consult">
				</image>
			</view>

		</view>

		<view class="banner-swiper">
			<image class="banner-image" src="../../static/images/dialog1.png" mode=""></image>
		</view>
		<view class="group-menu">
			<view class="group-menu-item" @click="openBuilding()">
				<image class="group-menu-item-icon" src="../../static/images/Frame_12.png"></image>
				<view class="group-menu-item-text">热改楼盘</view>
			</view>
			<view class="group-menu-item" @click="openBag()">
				<image class="group-menu-item-icon" src="../../static/images/Frame_10.png"></image>
				<view class="group-menu-item-text">拎包入住</view>
			</view>
			<view class="group-menu-item" @click="openWork()">
				<image class="group-menu-item-icon" src="../../static/images/Frame_11.png"></image>
				<view class="group-menu-item-text">工地实景</view>
			</view>
			<view class="group-menu-item">
				<image class="group-menu-item-icon" src="../../static/images/Frame3_1.png"></image>
				<view class="group-menu-item-text">保洁阿姨</view>
			</view>
		</view>
		<view class="list-content">
			<view class="building-list">
				<view class="building-header">
					<view class="building-header-left">
						<view class="line"></view> 热改楼盘
					</view>
					<view class="building-header-right" @click="openBuilding()">
						更多
					</view>
				</view>
				<view class="building-list-content">
					<view class="building-item-content" v-for="item in buildList">
						<image class="building-item-image" mode="aspectFill" :src="item.thumb">
						</image>
						<view class="building-item-mark">
							<view class="building-item-title">{{item.name}}</view>
							<view class="building-item-desc">{{item.model.name}}²/{{item.style.name}}</view>
						</view>
					</view>
				</view>

			</view>
			<!-- 拎包入住 -->
			<view class="handbag-list">
				<view class="building-header">
					<view class="building-header-left">
						<view class="line"></view> 拎包入住
					</view>
					<view class="building-header-right" @click="openBag()">
						更多
					</view>
				</view>
				<view class="building-list-content">
					<view class="building-item-content" v-for="(item,index) in comboList" :key="index">
						<image class="building-item-image" mode="aspectFill" :src="item.thumb">
						</image>
						<view class="building-item-markss">
							<view class="building-item-title">{{item.name}}</view>
							<view class="building-item-desc">{{item.model}}²</view>
							<view class="building-item-desc">{{item.desc_str}}</view>
						</view>
					</view>
					
				</view>
			</view>
			<!-- 工地实景 -->
			<view class="work-list">

				<view class="building-header">
					<view class="building-header-left">
						<view class="line"></view> 工地实景
					</view>
					<view class="building-header-right">
						更多
					</view>
				</view>
				<view class="building-list-content">
					<view class="building-item-contents" v-for="(item,index) in constructionList">
						<image class="building-item-images" :src="item.thumb">
						</image>
						<view class="building-item-marks">
							<view class="text">{{item.name}}</view>
						</view>
					</view>
				
				</view>
			</view>
	</view>
	</view>
</template>
<script>
	export default {
		data() {
			return {
				title: 'Hello',
				isShowDialog: true,
				isShowClick: false,
				data: {},
				buildList:[],
				comboList:[],
				constructionList:[]
			};
		},
		onLoad() {
			this.getShouYe()
		},
		methods: {
			openHot() {
				uni.navigateTo({
					url: "/pages/message/index"
				})
			},
			openBag() {
				uni.navigateTo({
					url: "/pages/luggage/index"
				})
			},
			openBuilding() {
				uni.navigateTo({
					url: "/pages/building/index"
				})
			},
			openWork() {
				uni.navigateTo({
					url: "/pages/work/index"
				})
			},
			getShouYe() {
				var then = this
				this.$http.post("/system/getBaseInfo", {}).then(res => {
					console.log(res);
					then.data = res.data.data
					
				})
				this.$http.post("/system/getIndexData", {}).then(res => {
					console.log(res);
					then.buildList = res.data.data.buildList
					then.comboList=res.data.data.comboList
					then.constructionList=res.data.data.constructionList
				})
			}

		}
	};
</script>

<style>
	.right-bottom {
		position: fixed;
		bottom: 132rpx;
		right: 20rpx;
		z-index: 888;
	}

	.connection {
		border-radius: 8px;
		background-color: rgba(255, 255, 255, 0.8);
		width: 181px;
		box-shadow: 0px 4px 8px rgba(0, 0, 0, 0.4);
	}

	.header {
		display: flex;
		justify-content: space-between;
		align-items: center;
		padding: 20rpx;
	}

	.header-title {
		margin-left: 10px;
		font-size: 16px;
	}

	.close-icon {
		width: 22px;
		height: 22px;
		margin-right: 0rpx;
	}

	.line-list {
		height: 14px;
		width: 3px;
		background-color: #009900;
	}

	.xian {
		height: 1px;
		width: 100%;
		background-color: rgba(0, 0, 0, 0.05);
	}

	.connection-item:first-child {
		margin-top: 16px;
	}

	.connection-item:last-child {
		padding-bottom: 20px;
	}

	.header_content {
		align-items: center;
		display: flex;
		margin-left: 0rpx;
	}

	.connection-item-image {
		width: 22px;
		height: 22px;
		margin-left: 23px;
	}

	.connection-item-image image {
		width: 100%;
		height: 100%;
	}

	.connection-item-title {
		margin-left: 20px;
	}

	.connection-item {
		display: flex;
		margin-top: 10px;
	}



	.index_dialog {
		position: fixed;
		width: 100%;
		height: 100vh;
		background: rgba(0, 0, 0, 0.5);
		z-index: 999;
		display: flex;
		flex-direction: column;
		align-items: center;
		justify-content: center;
	}

	.dialog_banner {
		width: 542rpx;
		height: 724rpx;
	}

	.dialog_clone {
		padding-top: 86rpx;
		width: 80rpx;
		height: 80rpx;
	}

	.text {
		font-size: 24rpx;
		font-weight: 700;
		color: #ffffff;
		line-height: 60rpx;
		margin: 0 auto;
		text-align: center;
	}

	.list-content {
		background: #F5F5F5;
	}

	.float-image {
		position: fixed;
		z-index: 333;
		bottom: 21rpx;
		right: 20rpx;
	}

	.float-image-consult {
		width: 182rpx;
		height: 222rpx;
		margin-bottom: 132rpx;
	}

	.building-item-title {
		font-size: 24rpx;
		font-weight: 700;
		color: #ffffff;
		line-height: 24rpx;
	}

	.building-item-desc {
		font-size: 20rpx;
		font-weight: 700;
		color: rgba(255, 255, 255, .8);
		line-height: 28rpx;
		margin-top: 14rpx;
	}

	::-webkit-scrollbar {
		/* width: 0; */
		display: none;
	}

	.building-list-content {
		box-sizing: border-box;
		overflow-x: auto;
		margin-top: 20rpx;
		display: flex;
	}

	.building-item-content {
		width: 382rpx;
		height: 578rpx;
		margin-right: 40rpx;
		position: relative;
	}

	.building-item-contents {
		width: 520rpx;
		height: 312rpx;
		margin-right: 40rpx;
		position: relative;
	}

	/* 热改楼盘展示图片 */
	.building-item-image {
		width: 382rpx;
		height: 510rpx;
		border-radius: 12rpx;
	}

	.building-item-images {
		width: 520rpx;
		height: 312rpx;
		border-radius: 12rpx;
	}

	/* 笼罩阴影透明部分 */
	.building-item-mark {
		position: absolute; //子元素使用 absolute 父元素必须为相对定位 否则它"丢"了
		bottom: 34px;
		left: 0px;
		width: 382rpx;
		height: 94rpx;
		background: rgba(0, 0, 0, .3);
		border-radius: 0rpx 0rpx 16rpx 16rpx;
		box-sizing: border-box;
		/* 简写 */
		padding: 24rpx 12rpx;

		/* padding-left: 24rpx;
		padding-top: 12rpx;
		padding-bottom: 12rpx;
		padding-right: 24rpx; */
	}

	.building-item-markss {
		position: absolute; //子元素使用 absolute 父元素必须为相对定位 否则它"丢"了
		bottom: 34px;
		left: 0px;
		width: 382rpx;
		height: 164rpx;
		background: rgba(0, 0, 0, .3);
		border-radius: 0rpx 0rpx 16rpx 16rpx;
		box-sizing: border-box;
		/* 简写 */
		padding: 24rpx 12rpx;
	}

	.building-item-marks {
		position: absolute; //子元素使用 absolute 父元素必须为相对定位 否则它"丢"了
		bottom: 0px;
		left: 0px;
		width: 520rpx;
		height: 66rpx;
		background: rgba(0, 0, 0, .3);
		border-radius: 0rpx 0rpx 16rpx 16rpx;
	}

	* {
		margin: 0 auto;
		padding: 0 0;
	}

	.content {
		width: 100vw;
		height: 100vh;
		background-color: #F5F5F5;
		box-sizing: border-box; //盒子模型
	}

	.banner-swiper {
		width: 100%;
		height: 450rpx;
	}

	.banner-image {
		width: 100%;
		height: 100%;
	}

	.group-menu {
		box-sizing: border-box;
		padding: 40rpx 52rpx;
		display: flex;
		justify-content: space-between;
		align-items: center;

	}

	.group-menu-item {
		display: flex;
		flex-direction: column;
		align-items: center;
	}

	.group-menu-item-icon {
		width: 80rpx;
		height: 80rpx;
	}

	.group-menu-item-text {
		font-size: 24rpx;
		font-weight: 500;
		color: #333333;
		margin-top: 8rpx;
		line-height: 24rpx;
	}

	.building-list {
		background: #ffffff;
		box-sizing: border-box;
		padding-left: 30rpx;
		padding-top: 34rpx;
		padding-bottom: 28rpx;
		position: relative;
		margin-bottom: 40rpx;
	}

	.handbag-list {
		background: #ffffff;
		box-sizing: border-box;
		padding-left: 30rpx;
		padding-top: 34rpx;
		padding-bottom: 28rpx;
		margin-top: 40rpx;
		position: relative;
	}

	.work-list {
		background: #ffffff;
		box-sizing: border-box;
		padding-left: 30rpx;
		padding-top: 34rpx;
		padding-bottom: 28rpx;
		margin-top: 40rpx;
		position: relative;
	}

	.building-header {
		width: 100%;
		display: flex;
		align-items: center;
		justify-content: space-between;
	}

	.building-header-left {
		font-size: 28rpx;
		font-weight: 700;
		color: #333333;
		line-height: 28rpx;
		margin-left: 10rpx;
		display: flex;
		align-items: center;
	}

	.line {
		width: 6rpx;
		height: 28rpx;
		background: #3d9c36;
		margin-right: 20rpx;
	}

	.building-header-right {
		font-size: 24rpx;
		font-weight: 500;
		color: #333333;
		line-height: 24rpx;
		margin-right: 45rpx;
	}

	.building-header-right::after {
		content: ">";
		margin-left: 10rpx;
		margin-right: 10rpx;
	}
</style>